#pragma once

#include "neighborhood2.h"
#include "longinstance.h"
#include "eightlayerim.h"
//#include "imagematrix.h"
#include <assert.h>

class PixelHistory
{
private:
	//int age;
	vector<Neighborhood2> memory;

public:
	PixelHistory() {};
	PixelHistory(const PixelHistory& other);
	//PixelHistory(const vector<Neighborhood>& nb);
	PixelHistory (const EightLayerIM& images, int row, int col);
	PixelHistory (const EightLayerIM& images, int row, int col, int historySize);
	PixelHistory (const EightLayerIM& images, int row, int col, int firstLayer, int lastLayer, int nbRadius = NRADIUS);
	void fillFromELIMLayers (const EightLayerIM& images, int firstLayer, int lastLayer, int row, int col, int nbRadius);
	PixelHistory& operator= (const PixelHistory& other);
	bool operator== (const PixelHistory& other);

	int age() const {return this->memory.size();}
	int getNBAtTime(int nbIndex, int timeStep) const;
	LongInstance makeLongInstance (int label) const;

	friend ostream& operator<< (ostream& stream, const PixelHistory& ph);
};
